import request from '@/utils/request'

export default{

  addCourseInfo(courseInfo) {
    return request({
      url: `/eduservice/course/addCourseInfo`,
      method: 'post',
      data: courseInfo
    })
  },

  getListTeacher() {
    return request({
      url: `/eduservice/teacher/findAll`,
      method: 'get'
    })
  },

  getCourseInfoId(id) {
    return request({
      url: `/eduservice/course/getCourseInfo/${id}`,
      method: 'get'
    })
  },

  updateCourseInfo(courseInfo) {
    return request({
      url: `/eduservice/course/updateCourseInfo`,
      method: 'post',
      data: courseInfo
    })
  },

  getPublishCourseInfo(id){
    return request({
      url: `/eduservice/course/getPublishCourseInfo/${id}`,
      method: 'get'
    })
  },

  
  publishCourse(id){
    return request({
      url: `/eduservice/course/publishCourse/${id}`,
      method: 'post'
    })
  },

  getPageList(page, limit, searchObj) {
    return request({
      url: `eduservice/course/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  },
}